#include "tpspecdesign.h"

TpSpecDesign::TpSpecDesign()
{
    m_intflag = SLS;
    m_set = true;
}

TpSpecDesign::TpSpecDesign(const TpSpecDesign& tp)
{
    m_intflag = tp.m_intflag;
    m_set = m_set;
}

TpSpecDesign::TpSpecDesign(const int& tp)
{
    setFlag(tp);
}

TpSpecDesign& TpSpecDesign::operator = (const TpSpecDesign& tp)
{
    m_intflag = tp.m_intflag;
    m_set = tp.m_set;
    return *this;
}

void  TpSpecDesign::setFlag(const int& tp)
{
    switch (tp)
    {
    case SLS :
        m_intflag = SLS;
        m_set = true;
        break;
    case ULS :
        m_intflag = ULS;
        m_set = true;
        break;
    }
}

bool  TpSpecDesign::setFlag(const string& str)
{
    if ( str.compare( "SLS" ) == 0 )
    {
        m_intflag = SLS;
        m_set = true;
        return true;
    }
    if ( str.compare( "ULS" ) == 0 )
    {
        m_intflag = ULS;
        m_set = true;
        return true;
    }
    return false;
}

string	TpSpecDesign::getFlagStr(void) const
{
    switch ( m_intflag )
    {
    case SLS :
        return( "SLS" );
    case ULS:
        return( "ULS" );
    }
    return( "" );
}
